package collection.Demo07;

import collection.Demo02.Student;

import java.util.LinkedList;

/**
 * @Author Miku
 * @Create 2021/4/16 14:02
 */
public class Test {
    public static void main(String[] args) {
        //创建列表
        LinkedList linkedList = new LinkedList();
        Student s1 = new Student("miku", 16);
        Student s2 = new Student("sakura", 18);
        Student s3 = new Student("test", 20);
        linkedList.add(s1);
        linkedList.add(s2);
        linkedList.add(s3);
        System.out.println("元素长度:" + linkedList.size());
        System.out.println(linkedList);

        //遍历列表
        for (Object object : linkedList) {
            System.out.println(object);
        }

    }
}
